﻿package pluginfw.nio
{
    import flash.utils.*;

    public class LongUtils extends Object
    {
        private static var cache:Dictionary = new Dictionary();

        public function LongUtils()
        {
            return;
        }// end function

        public static function clear() : void
        {
            cache = new Dictionary();
            return;
        }// end function

        public static function asLong(param1) : Long
        {
            if (param1 is Long)
            {
                return param1 as Long;
            }
            if (param1 is int)
            {
                return create(0, param1);
            }
            var _loc_2:* = new Number(param1);
            return create(uint(_loc_2 / (4294967295 + 1)), uint(_loc_2 % (4294967295 + 1)));
        }// end function

        public static function create(param1:uint, param2:uint) : Long
        {
            if (cache[param1] && cache[param1][param2])
            {
                return cache[param1][param2];
            }
            var _loc_3:* = new Long(param1, param2);
            if (!cache[param1])
            {
                cache[param1] = new Dictionary();
            }
            cache[param1][param2] = _loc_3;
            return _loc_3;
        }// end function

        public static function remove(param1:Long) : void
        {
            var _loc_2:* = param1.getHigh();
            var _loc_3:* = param1.getLow();
            if (cache[_loc_2] && cache[_loc_2][_loc_3])
            {
                delete cache[_loc_2][_loc_3];
            }
            return;
        }// end function

    }
}
